/*
 * Copyright 2025 The JA-SIG Collaborative. All rights reserved. distributed with this file and
 * available online at
 */
package com.lap.auth.application.project.assembler;

import org.mapstruct.Mapper;
import com.lap.auth.application.project.command.CreateProjectCmd;
import com.lap.auth.application.project.command.UpdateProjectCmd;
import com.lap.auth.domain.project.Project;
import com.lap.auth.domain.project.valueobject.ProjectType;
import com.lap.auth.domain.project.valueobject.StatusType;
import com.lap.framework.tools.EnumUtil;

@Mapper(componentModel = "spring")
public interface ProjectAssembler {

  Project toDomain(CreateProjectCmd cmd);

  Project toDomain(Integer id, UpdateProjectCmd cmd);

  default ProjectType codeToType(Integer code) {
    return EnumUtil.fromCode(ProjectType.class, code);
  }

  default StatusType codeToStatus(Integer code) {
    return EnumUtil.fromCode(StatusType.class, code);
  }
}
